DROP TABLE TicketTroubleTypes;

\c coned
\t
\o INSERT_TicketTroubleTypes.sql
SELECT DISTINCT 'INSERT INTO TicketTroubleTypes(TicketNumber, TroubleType) VALUES (''' || "Ticket" || ''', ''' || "TroubleType_Substring" || '''); '
	FROM "ColumbiaConsolidatedTable_ECSAndStructureInformation_1996_2006" ORDER BY "Ticket";
\o
\c gatedb
CREATE TABLE TicketTroubleTypes(TicketNumber CHARACTER(10) PRIMARY KEY, TroubleType CHARACTER VARYING(5));
\i INSERT_TicketTroubleTypes.sql

